<script setup lang="ts">
import { ref } from "vue";
import UserInfo from "./UserInfo.vue";

const user = ref({
  username: "张三",
  age: 30,
  email: "zhangsan@example.com",
  phone: "无",
});
const updateUser = () => {
  user.value = {
    username: "李四",
    age: 25,
    email: "lis@example.com",
    phone: "有",
  };
};
</script>
<template>
  <UserInfo :user="user"></UserInfo>
  <button @click="updateUser">更新用户信息</button>
</template>
